# Set build-directive (used in core to tell which buildtype we used)
add_definitions(-D_BUILD_DIRECTIVE=${CMAKE_BUILD_TYPE})

if( USE_SFMT)
  if(PLATFORM EQUAL 32)
    # Required on 32-bit systems to enable SSE2 (standard on x64)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mfpmath=sse")
  endif()
  add_definitions(-DHAVE_SSE2 -D__SSE2__)
  message(STATUS "Clang: SFMT enabled, SSE2 flags forced")
endif()

if( WITH_WARNINGS )
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wfatal-errors -Wextra")
  message(STATUS "Clang: All warnings enabled")
else()
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --no-warnings")
  message(STATUS "Clang: All warnings disabled")
endif()

if( WITH_COREDEBUG )
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb -g3 -O0")
  message(STATUS "Clang: Debug-flags set (-ggdb -g3 -O0)")
else()
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
endif()

